home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 235 / Issue 235 - September 2007 - DPCS0907DVD.ISO / Extras / NetObjects Fusion / NOF10.exe / data1.cab / FSI / lib / nof / dataobjects / tables / ecomm / OptionGroupsTable.js < prev    next >
Encoding:
Text File  |  2007-04-11  |  1.7 KB  |  48 lines

  1. function NOF_DataObjects_OptionGroupsTable(){
  2.   this.__proto__       = NOF_DataObjects_OptionGroupsTable.prototype;
  3.  
  4.   this.SUPER( NOF_TableTypes.NODELESS | NOF_TableTypes.ECOMM_CATALOG, "OptionGroups", "Id");
  5.   this.__constructor__ =  NOF_DataObjects_OptionGroupsTable;
  6. }
  7.  
  8. NOF_DataObjects_OptionGroupsTable.inherits( NOF.DO.Table ); function NOF_DataObjects_OptionGroupsTable_ProtoBuilder(){
  9.   var NOF_DataObjects_OptionGroupsTable_DDL = new Array(
  10.     new NOF.DO.FieldInfo("Id", NOF.DO.FieldType.INTEGER, 0),
  11.     new NOF.DO.FieldInfo("Name", NOF.DO.FieldType.VARCHAR, 1),
  12.     new NOF.DO.FieldInfo("Label", NOF.DO.FieldType.VARCHAR, 2),
  13.     new NOF.DO.FieldInfo("Position", NOF.DO.FieldType.INTEGER, 3),
  14.     new NOF.DO.FieldInfo("Sorted",NOF.DO.FieldType.VARCHAR, 4)  
  15.     );
  16.   
  17.   var method = NOF_DataObjects_OptionGroupsTable.prototype;
  18.   
  19.   method.COL_ID       = 0;  
  20.   method.COL_NAME     = 1;
  21.   method.COL_LABEL    = 2;  
  22.   method.COL_POSITION = 3;
  23.   method.COL_SORTED   = 4;
  24.   
  25.   method.getDDL = function getDDL(){
  26.     return NOF_DataObjects_OptionGroupsTable_DDL;
  27.   }; 
  28.   
  29.   method.selectById = function selectById( id ){
  30.     return this.selectByFields( [new NOF.DO.FieldValue ("Id", id)]);    
  31.   };
  32.  
  33.   method.deleteById = function deleteById( id ){
  34.     return this.deleteByFields ([new NOF.DO.FieldValue ("Id", id)]);  
  35.   };
  36.   
  37.   method.selectByName = function selectByName( name ){
  38.     return this.selectByFields( [new NOF.DO.FieldValue ("Name", name)]);    
  39.   };
  40.  
  41.   method.updateById = function updateById( id, fields ){
  42.     return this.updateByFields( [new NOF.DO.FieldValue ("Id", id)], fields);
  43.   };
  44.   
  45. }
  46.   
  47. NOF_DataObjects_OptionGroupsTable_ProtoBuilder();  
  48.